export const getSafeAreaInsets = async () => {
	//获取系统安全区信息
	let systemInfo = await uni.getSystemInfoSync();
	let safeArea = systemInfo.safeArea || {};
	let screenHeight = systemInfo.screenHeight;
	let screenWidth = systemInfo.screenWidth;
	// let statusBarHeight = systemInfo.statusBarHeight ||safeArea.top || 30;
	let statusBarHeight = systemInfo.statusBarHeight ? systemInfo.statusBarHeight : safeArea.top ? safeArea.top : 30;
	console.log(statusBarHeight);
	let sysTop = statusBarHeight;
	let sysBottom = 0
	// #ifdef APP-PLUS
	sysBottom = screenHeight - safeArea.bottom;
	// #endif
	// if (!sysBottom) {
	// 	sysBottom = 15
	// }
	let sysLeft = safeArea.left || 0;
	let sysRight = screenWidth - safeArea.right;
	let sysButHeight = null;
	//获取胶囊按钮位置信息
	// #ifdef MP-WEIXIN
	let menuButton = await uni.getMenuButtonBoundingClientRect();
	let butTop = menuButton.top;
	let butbottom = menuButton.bottom;
	let butleft = menuButton.left;
	let butright = menuButton.right;
	let butwidth = menuButton.width;
	let butheight = menuButton.height;
	sysButHeight = (butTop - sysTop) * 2 + butheight;
	// #endif
	// #ifdef H5
	sysBottom = 0;
	sysTop = 0
	sysButHeight = 0
	// #endif
	console.log(sysTop, sysButHeight, sysBottom)
	return {
		sysTop,
		sysButHeight,
		sysBottom
	};
}